
package at.fhj.itm.metadata.impl.postgres;

import at.fhj.itm.metadata.ForeignKeyConstraint;
import java.util.List;

/**
 *
 * @author Seuchter
 */
public class PostgresForeignKey extends PostgresConstraint implements ForeignKeyConstraint {

    private String updateAction;
    private String deleteAction;
    private boolean deferable;
    private boolean defered;
    private List<PostgresColumn> referencingColumns;
    private PostgresTable refercingTable;

    public PostgresForeignKey(long oid, String name, String updateAction, String deleteAction,
            boolean  deferable, boolean defered, List<PostgresColumn> referencingColumn,
            List<PostgresColumn> foreignColumns, PostgresTable foreignTable)
    {
        super(oid, name,foreignColumns, PostgresConstraint.CONSTRAINT_TYPE_FOREIGN);
        this.updateAction = updateAction;
        this.deleteAction = deleteAction;
        this.deferable = deferable;
        this.defered = defered;
        this.referencingColumns = referencingColumn;
        this.refercingTable = foreignTable;
    }

    public String getUpdateAction()
    {
       return updateAction;
    }

    public String getDeleteAction()
    {
        return deleteAction;
    }

    public boolean isDefereable()
    {
        return deferable;
    }

    public boolean isInitialyDefered()
    {
        return defered;
    }

    public PostgresTable getReferencingTable()
    {
        return refercingTable;
    }
    public List<PostgresColumn> getReferencingColumns()
    {
       return referencingColumns;
    }


}
